double average(int* salary, int salarySize) {
    int i = 0;
    double sum = 0;
    for (i = 0; i < salarySize - 1; i++)
    {

        for (int j = i + 1; j < salarySize; j++)
        {
            if (salary[i] > salary[j])
            {
                int tmp = salary[i];
                salary[i] = salary[j];
                salary[j] = tmp;
            }
        }

    }
    for (int i = 1; i < salarySize - 1; i++)
    {
        sum += salary[i];
    }
    double num = 0;
    num = sum / (salarySize - 2);


    return num;
}